package com.wus.demo1.controller;

import com.wus.common.core.domain.base.Result;
import com.wus.demo1.config.properties.CommonConfigProperties;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: API测试
 * @Author: wus
 * @Date: 2024/12/8 23:39
 */
@Tag(name = "测试管理")
@RequiredArgsConstructor
@RequestMapping("/test")
@RestController
public class TestController {

    private final Logger logger = LoggerFactory.getLogger(TestController.class);

    private final CommonConfigProperties commonConfigProperties;

    @Operation(summary = "hello接口")
    @GetMapping("/hello")
    public Result<String> hello() {
        logger.info("demo1....{}", commonConfigProperties.getVar1());
        // int i = 1 / 0;
        return Result.ok("demo1 response to hello");
    }
}
